<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.2</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <link rel="stylesheet" href="lib/layui/css/layui.css">
    <script type="text/javascript" src="lib/layui/layui.js"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script type="text/javascript" src="js/gainID.js"></script>
    <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="js/aircraft_carrier_list.js"></script>

    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .login-container {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }
    </style>
</head>

<body>
<div style="display: none;" class="login-container" id="createAircraftCarrier">
    <form class="layui-form" id="addAircraftCarrier">
        <div class="layui-form-item">
            <label class="layui-form-label">舷号</label>
            <div class="layui-input-inline">
                <input type="text" name="portNumber" required lay-verify="required" lay-reqtext="请输入舷号"
                       placeholder="请输入舷号" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-inline">
                <input type="text" name="name" required lay-verify="required" lay-reqtext="请输入名称"
                       placeholder="请输入名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">全长</label>
            <div class="layui-input-inline">
                <input type="text" name="overallLength" required lay-verify="required|number" lay-reqtext="请输入全长"
                       placeholder="请输入全长" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">建造年代</label>
            <div class="layui-input-inline">
                <input type="text" name="ageOfConstruction" id="ageOfConstruction" required lay-verify="required"
                       lay-reqtext="请输入建造年代"
                       placeholder="请输入建造年代" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排水量</label>
            <div class="layui-input-inline">
                <input type="text" name="displacement" required lay-verify="required|number"
                       lay-reqtext="请输入排水量"
                       placeholder="请输入排水量" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">型号</label>
            <div class="layui-input-inline">
                <input type="text" name="rank" required lay-verify="required" lay-reqtext="请输入级别"
                       placeholder="请输入级别" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">吃水深度</label>
            <div class="layui-input-inline">
                <input type="text" name="draught" required lay-verify="required|number" lay-reqtext="请输入吃水深度"
                       placeholder="请输入吃水深度" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">航速</label>
            <div class="layui-input-inline">
                <input type="text" name="carrierSpeed" required lay-verify="required|number" lay-reqtext="请输入航速"
                       placeholder="请输入航速" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">续航力</label>
            <div class="layui-input-inline">
                <input type="text" name="endurance" required lay-verify="required" lay-reqtext="请输入续航力"
                       placeholder="请输入续航力" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">功率</label>
            <div class="layui-input-inline">
                <input type="text" name="power" required lay-verify="required|number" lay-reqtext="请输入功率"
                       placeholder="请输入功率" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">母港</label>
            <div class="layui-input-inline">
                <input type="text" name="homePort" lay-reqtext="请输入母港"
                       placeholder="请输入母港" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">搭载导弹</label>
            <div class="layui-input-inline">
                <input type="text" name="missile" lay-reqtext="请输入搭载导弹"
                       placeholder="请输入搭载导弹" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">搭载火炮</label>
            <div class="layui-input-inline">
                <input type="text" name="gun" lay-reqtext="请输入搭载火炮"
                       placeholder="请输入搭载火炮" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">雷达</label>
            <div class="layui-input-inline">
                <input type="text" name="radar" lay-reqtext="请输入雷达"
                       placeholder="请输入雷达" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指挥员</label>
            <div class="layui-input-inline">
                <input type="text" name="commander" lay-reqtext="请输入指挥员"
                       placeholder="请输入指挥员" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" id="addButton" lay-submit lay-filter="addAircraftCarrier" type="submit">添加
                </button>
                <button type="reset" class="layui-btn">重置</button>
            </div>
        </div>
    </form>
</div>

<div style="display: none;" class="login-container" id="updateAircraftCarrierInfo">
    <form class="layui-form" id="updateAircraftCarrier">
        <div class="layui-form-item">
            <label class="layui-form-label">舷号</label>
            <div class="layui-input-inline">
                <input type="text" name="portNumber" required lay-verify="required" lay-reqtext="请输入舷号"
                       placeholder="请输入舷号" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-inline">
                <input type="text" name="name" required lay-verify="required" lay-reqtext="请输入名称"
                       placeholder="请输入名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">全长</label>
            <div class="layui-input-inline">
                <input type="text" name="overallLength" required lay-verify="required|number" lay-reqtext="请输入全长"
                       placeholder="请输入全长" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">建造年代</label>
            <div class="layui-input-inline">
                <input type="text" name="ageOfConstruction" id="ageOfConstruction1" required lay-verify="required"
                       lay-reqtext="请输入建造年代"
                       placeholder="请输入建造年代" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排水量</label>
            <div class="layui-input-inline">
                <input type="text" name="displacement" required lay-verify="required|number"
                       lay-reqtext="请输入排水量"
                       placeholder="请输入排水量" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">型号</label>
            <div class="layui-input-inline">
                <input type="text" name="rank" required lay-verify="required" lay-reqtext="请输入级别"
                       placeholder="请输入级别" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">吃水深度</label>
            <div class="layui-input-inline">
                <input type="text" name="draught" required lay-verify="required|number" lay-reqtext="请输入吃水深度"
                       placeholder="请输入吃水深度" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">航速</label>
            <div class="layui-input-inline">
                <input type="text" name="carrierSpeed" required lay-verify="required|number" lay-reqtext="请输入航速"
                       placeholder="请输入航速" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">续航力</label>
            <div class="layui-input-inline">
                <input type="text" name="endurance" required lay-verify="required" lay-reqtext="请输入续航力"
                       placeholder="请输入续航力" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">功率</label>
            <div class="layui-input-inline">
                <input type="text" name="power" required lay-verify="required|number" lay-reqtext="请输入功率"
                       placeholder="请输入功率" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">母港</label>
            <div class="layui-input-inline">
                <input type="text" name="homePort" lay-reqtext="请输入母港"
                       placeholder="请输入母港" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">搭载导弹</label>
            <div class="layui-input-inline">
                <input type="text" name="missile" lay-reqtext="请输入搭载导弹"
                       placeholder="请输入搭载导弹" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">搭载火炮</label>
            <div class="layui-input-inline">
                <input type="text" name="gun" lay-reqtext="请输入搭载火炮"
                       placeholder="请输入搭载火炮" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">雷达</label>
            <div class="layui-input-inline">
                <input type="text" name="radar" lay-reqtext="请输入雷达"
                       placeholder="请输入雷达" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指挥员</label>
            <div class="layui-input-inline">
                <input type="text" name="commander" lay-reqtext="请输入指挥员"
                       placeholder="请输入指挥员" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" id="updateButton" lay-submit lay-filter="updateAircraftCarrier" type="submit">
                    修改
                </button>
                <button type="reset" class="layui-btn">重置</button>
            </div>
        </div>
    </form>
</div>


<div class="x-nav">
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
    </a>
</div>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div id="aircraftCarrierInfo" class="layui-card-header">
                    <button id="add" class="layui-btn"><i
                            class="layui-icon"></i>添加
                    </button>
                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-hide" id="aircraftCarrier" lay-filter="pageTable"></table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    window.onload = function () {
        let jobType = sessionStorage.getItem("type");
        let aircraftCarrierInfo = document.getElementById('aircraftCarrierInfo');
        if (jobType == '4') {
            aircraftCarrierInfo.style.display = 'block';
        } else {
            aircraftCarrierInfo.style.display = 'none';
        }
    }

</script>
<script type="text/html" id="barEdit">
    <! --添加审核状态按钮 -->
    {{#  if(d.jobType != 4){ }} <!--d相当于layui里边的field -->
    <span style="cursor: pointer" id="show">
			<i class="layui-icon" lay-event="edit">&#xe642;</i>
			<i class="layui-icon" lay-event="del">&#xe640;</i>
        <!--            <i class="layui-icon" lay-event="state">&#xe631;</i>-->
    </span>
    {{#  } else { }}
    <button class="layui-btn layui-btn-danger layui-btn-xs">暂无操作</button>
    {{#  } }}
</script>
</html>